package concept.chapter7.sorting;

/**
 * DOM POJO that is comparable
 * 
 * @author kan.sun
 *
 */
public class DVDInfo implements Comparable<DVDInfo>
{
	private String title;
	private String genre;
	private String leadActor;
	
	DVDInfo(String t, String g, String s)
	{
		this.title = t;
		this.genre = g;
		this.leadActor = s;
	}
	
	public String toString()
	{
		return title+"/ "+genre+"/ "+leadActor+"\n";
	}

	public String getTitle()
	{
		return title;
	}

	public void setTitle(String title)
	{
		this.title = title;
	}

	public String getGenre()
	{
		return genre;
	}

	public void setGenre(String genre)
	{
		this.genre = genre;
	}

	public String getLeadActor()
	{
		return leadActor;
	}

	public void setLeadActor(String leadActor)
	{
		this.leadActor = leadActor;
	}

	@Override
	public int compareTo(DVDInfo o)
	{
		return title.compareTo(o.title);
	}
}
